<template>
    <view>
       <web-view :src="url"></web-view>
    </view>
</template>


<script>
	export default {
		data() {
			return {
				title: this.title,
				data:"",
				url:"",
				username:"",
				api_name :"",
				device : "2",
			}
		},
		methods: {
			setNaivgationBarTitle: function (e) {
				var title = e.target.value.title
				uni.setNavigationBarTitle({
					title: title + '游戏',
					success: () => {
						console.log('setNavigationBarTitle success')
					},
					fail: (err) => {
						console.log('setNavigationBarTitle fail, err is', err)
					}
				})
			}
		},
		onLoad(e){
			//this.gameApiUrl + 'playGame&username=' + this.userName + '&api_name=' + api_name + '&game=' + game_id + '&device=2';
				this.title = e.api_name;
				this.username = e.username;
				this.game = e.game;
				this.api_name = e.api_name;
				this.device = e.device;
				
				this.url = e.url + '?api_method=playGame&username=' + this.username + '&api_name='+ this.api_name+'&game=' + this.game + '&device=' + this.device;
				console.log(this.url);
				uni.setNavigationBarTitle({
					title: this.title,
					success: () => {
						console.log('setNavigationBarTitle success')
					},
					fail: (err) => {
						console.log('setNavigationBarTitle fail, err is', err)
					}
				});
		}
	}
</script>
<style>

</style>
